home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / mac / ch22 / 22fig04.wrl < prev    next >
Text File  |  1996-09-23  |  1KB  |  60 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright [1997] By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.     # Initial background
  8.         Background {
  9.             skyColor [ 0.0 0.2 0.7,  0.0 0.5 1.0,  1.0 1.0 1.0 ]
  10.             skyAngle [ 1.309, 1.571 ]
  11.             groundColor [ 0.1 0.1 0.0,  0.4 0.25 0.2,  0.6 0.6 0.6 ]
  12.             groundAngle [ 1.309, 1.571 ]
  13.         },
  14.     # Alternate backgrounds
  15.         DEF AltBack1 Background {
  16.             skyColor [ 1.0 0.0 0.0,  1.0 0.4 0.0,  1.0 1.0 0.0 ]
  17.             skyAngle [ 1.309, 1.571 ]
  18.             groundColor [ 0.1 0.1 0.0,  0.5 0.25 0.2,  0.6 0.6 0.2 ]
  19.             groundAngle [ 1.309, 1.571 ]
  20.         },
  21.         DEF AltBack2 Background {
  22.             skyColor [ 1.0 0.0 0.8,  0.5 0.0 0.8,  0.0 0.0 0.8 ]
  23.             skyAngle [ 1.309, 1.571 ]
  24.             groundColor [ 0.0 0.0 0.1,  0.0 0.1 0.3,  0.3 0.3 0.6 ]
  25.             groundAngle [ 1.309, 1.571 ]
  26.         },
  27.     # Shapes to act as buttons
  28.         Transform {
  29.             translation -2.0 0.0 0.0
  30.             children [
  31.                 Shape {
  32.                     appearance Appearance {
  33.                         material Material {
  34.                             diffuseColor 1.0 0.0 0.0
  35.                         }
  36.                     }
  37.                     geometry Box { }
  38.                 },
  39.                 DEF TouchBox TouchSensor { }
  40.             ]
  41.         },
  42.         Transform {
  43.             translation 2.0 0.0 0.0
  44.             children [
  45.                 Shape {
  46.                     appearance Appearance {
  47.                         material Material {
  48.                             diffuseColor 0.0 0.0 0.8
  49.                         }
  50.                     }
  51.                     geometry Sphere { }
  52.                 },
  53.                 DEF TouchSphere TouchSensor { }
  54.             ]
  55.         }
  56.     ]
  57. }
  58. ROUTE TouchBox.isActive    TO AltBack1.set_bind
  59. ROUTE TouchSphere.isActive TO AltBack2.set_bind
  60.